Skip to content

Fixes scope validation failure in issue #8 - #9

Open
WASDDestroy wants to merge 4 commits into
CommandPrompt-Wang:mainfrom
WASDDestroy:main
Open

Fixes scope validation failure in issue #8#9
WASDDestroy wants to merge 4 commits into
CommandPrompt-Wang:mainfrom
WASDDestroy:main

Conversation

@WASDDestroy

Copy link
Copy Markdown

Fixes #8. "The module currently displays a persistent 'wrong scope' error to users, even when the correct scope is selected."

Root Cause

The error stems from ConfigIPCManager.java, which attempts to write the active scope to a shared preference via an IPC call. Directly accessing module's SharedPreference is not recommended in modern Xposed framework's hook callbacks and it will always fails.

Solution

  • Direct API Query: Implements getScope() in ModuleServiceBridge.java. Since the module declares libxposed API 101, we can now reliably fetch the active scope list directly from the framework service, bypassing the unreliable preference-writing mechanism.
  • Refactored Validation: Updates statusOrdinal() in MainActivity.kt to iterate over the list returned by getScope(), ensuring the UI accurately reflects whether the System Server is properly hooked.
  • Removes Obsolete Method: Deletes setModuleActive() and its call sites in MainHook.java. This method is redundant under API 101 (as the framework manages activation state).

Testing Performed

  • Verified on Android 16 (API 36) with LSPosed v2.1.0.
  • Confirmed that the "wrong scope" error no longer appears and the module status correctly displays as "Active".

we no longer needs this tricky method because LSPosed is capable to report module scope via libxposed service that binds on app launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 模块添加了作用域展示错误&部分文字错误问题

1 participant